package com.ehotting.edsta.testability.controller;

import com.ehotting.eaf.core.domain.R;
import com.ehotting.eaf.core.domain.system.api.SysOperLog;
import com.ehotting.eaf.core.enums.SimulationTypeEnum;
import com.ehotting.edsta.common.log.annotation.Log;
import com.ehotting.edsta.common.log.enums.BusinessType;
import com.ehotting.edsta.common.log.enums.OperatorType;
import com.ehotting.edsta.system.api.RemoteLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "LogController",description = "测试性分析日志记录")
@RequestMapping("/log")
@RestController
public class LogController {

    @Autowired
    private RemoteLogService remoteLogService;

    @ApiOperation("log")
    @Log(title = SimulationTypeEnum.TESTABILITY_NAME,businessType = BusinessType.OTHER,operatorType = OperatorType.OTHER)
    @PostMapping
    public R<String> log(@RequestBody SysOperLog operLog){
//        operLog.setTitle(SimulationTypeEnum.TESTABILITY.getName());
//        remoteLogService.saveLog(operLog, SecurityConstants.INNER);
        return R.ok();
    }
}
